// import { Select } from "antd"
import { FC } from "react"
import { useSelector } from "react-redux"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useLocale } from "@/locales"
import { AppState } from "@/stores"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const LockStatus: FC<{
	label?: string
	placeholder?: string
}> = props => {
	const { label, placeholder } = props
	const { formatMessage, newFormat } = useLocale()

	const { allDictLists } = useSelector((state: AppState) => state.config)
	const options = allDictLists["lockStatus"].map((item: { label: string; value: any }) => {
		return {
			label: newFormat(item.label),
			value: item.value
		}
	})

	return (
		<SFormItem name="lockStatus" label={formatMessage({ id: label || "funds.fund_audit.lock_status" })}>
			<StyleSelect
				placeholder={formatMessage({ id: placeholder ? placeholder : "common.select_all" })}
				allowClear
				options={options}
			/>
		</SFormItem>
	)
}
